
package com.be.beadmin.design.service;

import com.be.beadmin.common.entity.PageEntity;
import com.be.beadmin.design.dto.input.ProductDrawingInfoDto;
import com.be.beadmin.design.dto.output.ProductDrawingInfoEx;
import com.be.beadmin.design.entity.ProductDrawingInfo;
import io.minio.errors.*;
import org.springframework.data.domain.Page;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.List;

/**
* @description 服务接口
* @author zmy
* @date 2023-02-16
**/
public interface ProductDrawingInfoService {

    /**
    * 分页的查询接口
    * @param pageEntity
    * @return
    */
    Page<ProductDrawingInfoEx> getProductDrawingInfoByPage(PageEntity pageEntity);

    /**
    * @param productDrawingInfoDto
    */
    void addProductDrawingInfo(ProductDrawingInfoDto productDrawingInfoDto);

    /**
    * @param productDrawingInfoDto
    */
    void updateProductDrawingInfo(ProductDrawingInfoDto productDrawingInfoDto);

    /**
    * @param id
    */
    void delProductDrawingInfo(String id);

    /**
    * 删除多个角色
    * @param ids
    */
    void delProductDrawingInfos (List<String> ids);

    Page<ProductDrawingInfoEx> getDrawingByBatchProductId(HttpServletRequest request,PageEntity pageEntity, String batchProductId);

    void uploadDrawing(String productId, MultipartFile[] multipartFiles, String drawingSpec, String drawingBucketName,String category) throws Exception;

//    void changeDrawing(String productId, MultipartFile multipartFile, String drawingSpec, String drawingBucketName,String category) throws Exception;

    void updateProductDrawingInfo2(String drawingId, MultipartFile multipartFile, String drawingSpec, String drawingBucketName,String productCode) throws Exception;

    //void downloadProductDrawingInfo(String id, String drawingBucketName, HttpServletResponse response);

    void deleteProductDrawingInfo(String id, String drawingBucketName) throws InvalidBucketNameException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidPortException, InvalidKeyException, InvalidEndpointException, InvalidResponseException, XmlParserException, InternalException;

    /**
     * 根绝柜体id获取柜体的图纸
     * @param batchProductIds
     * @return
     */
    public List<ProductDrawingInfo> getProductDrawing(List<String> batchProductIds);

    void stopIsActive(String id);
    void updateIsActive2(String id,String productCode,String category);
}